<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="/templates/mainTemplate.xhtml">



	<ui:define name="windowTitle">
            #{msgs.loginTitle}
         </ui:define>
	<ui:define id="newProjectFromNote" name="content">


		<h:form>
			<h:panelGrid columns="2">

				<h:outputText value="Nazwa projektu" />
				<h:inputText value="#{newProjectFNBean.projectName}"
					style="font-size: 14px; font-style:oblique; width: 100%" />

				<h:outputLabel styleClass="textStyle" value="Opis projektu" />
				<h:inputTextarea
					style="resize: none; font-size: 14px; font-style:oblique"
					id="projectDesc" rows="5" cols="75"
					value="#{newProjectFNBean.projectDescription}" />
				
				<h:outputLabel styleClass="textStyle" value="Użytkownicy:" />
				<h:selectManyListbox size="5"
					value="#{newProjectFNBean.assignedUsers}">
					<f:selectItems value="#{newProjectFNBean.allUsersMap}" />
				</h:selectManyListbox>
				
				<h:outputLabel styleClass="textStyle" value="Wybierz załączniki:" />
				<rich:dataTable
					onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
					onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
					cellpadding="0" cellspacing="0" width="700" border="0"
					id="userList" style="width : 100%" styleClass="tableStyle"
					rowClasses="oddRow,evenRow" headerClass="tableHeader"
					value="#{newProjectFNBean.noteAttachmentsList}" var="noteAttachItem">
					<f:facet name="header">
						<rich:column>
							<h:outputText styleClass="textStyle" value="Załączniki" />

						</rich:column>
						<rich:columnGroup>
							<rich:column>
								<h:outputText styleClass="headerText" value="Nazwa" />
							</rich:column>
							<rich:column>
								<h:outputText styleClass="headerText" value="Dołącz do projektu" />
							</rich:column>
						</rich:columnGroup>
					</f:facet>
					<rich:column>
						<h:commandLink action="#{fileDownloadBean.saveNoteFile(noteAttachItem)}"
							value="#{noteAttachItem.fileName}" />
					</rich:column>
					<rich:column>
						<h:selectBooleanCheckbox value="#{noteAttachItem.isChecked}" /> 
					</rich:column>
				</rich:dataTable>

			</h:panelGrid>

			<h:panelGroup style="display:block; text-align:center; margin: 10px">
				<h:commandButton action="#{newProjectFNBean.saveProject}"
					value="Zapisz" />
				<h:commandButton action="#{newProjectFNBean.cancelAddProject}"
					value="Anuluj" />
			</h:panelGroup>

		</h:form>
	</ui:define>

</ui:composition>